/* 
 * To change this template, choose Tools | Templates
 * and open the template in the editor.
 */


var xhr;
//alert("llegue al js materias");
function buscarDetalle(){
    
    if(window.ActiveXObject){        
        xhr = new ActiveXObject("Microsoft.XMLHttp");
    }
    else if(window.XMLHttpRequest || (typeof XMLHttpRequest)!= undefined){
        xhr = new XMLHttpRequest();
    }
    else{
        alert("su navegador no soporta AJAX");
        return;
    }

}

function cajasmaterialic(){
    buscarDetalle();
    var lic = document.getElementById("lic").checked;
//    alert("valoor del check"+sec);
    xhr.open("GET","../svlprofesoreslic?lic="+lic,true);
    xhr.onreadystatechange = imprimircajasmaterialic;
    xhr.send(null);
}
function imprimircajasmaterialic(){
    if(xhr.readyState == 4){
        document.getElementById("checklic").innerHTML=xhr.responseText;
    }
}



function checkprimersecundaria(){
    buscarDetalle();
    xhr.open("GET","../primergradosecundaria",true);
    xhr.onreadystatechange = imprimecheksprimersecu;
    xhr.send(null);
}
function imprimecheksprimersecu(){

    if(xhr.readyState == 4){
        if(xhr.status == 200)    {
            document.getElementById("primersecundaria").innerHTML=xhr.responseText;
            checksegundosecundaria();
        }
    }
}

function checksegundosecundaria(){
    buscarDetalle();
    xhr.open("GET","../segundogradosecundaria",true);
    xhr.onreadystatechange = imprimechekssegundosecu;
    xhr.send(null);
}
function imprimechekssegundosecu(){

    if(xhr.readyState == 4){
        if(xhr.status == 200)    {
            document.getElementById("segundosecundaria").innerHTML=xhr.responseText;
            checktercerosecundaria();
        }
    }
}


function checktercerosecundaria(){
    buscarDetalle();
    xhr.open("GET","../tercerogradosecundaria",true);
    xhr.onreadystatechange = imprimechekstercerosecu;
    xhr.send(null);
}
function imprimechekstercerosecu(){

    if(xhr.readyState == 4){
        if(xhr.status == 200)    {
            document.getElementById("tercerosecundaria").innerHTML=xhr.responseText;
//            checksegundolicde();
        }
    }
}